<?php
    header('Content-type:text/json');
    require "../../connection.php";
    try{
            $name = $_POST['name'];
            $discount = $_POST['discount'];
            $price = $_POST['price'];
            $days = $_POST['days'];
            $id = $_POST['id'];
            $option = array("id"=>$id);
            $arr = array("name"=>$name,"discount"=>$discount,"price"=>$price,"days"=>$days);
            $result = $conn->where($option)->update("vip",$arr);
            if($result){
                $msg = "更新成功";
            }else{
                $msg = "更新失败";
            }
            $data = array("status"=>"1","msg"=>$msg);
            echo json_encode($data);
    }catch(Exception $e){
        print_r($e->getMessage());
    }
?>